package com.LeetCode.StackAndHeap;

public class ListNode {
    int val;
    ListNode next;
    ListNode(int x) { val = x; }

    public static void printList(ListNode node){
        while(node!=null){
            System.out.print(node.val + " ");
            node = node.next;
        }
        System.out.println();
    }
}
